package com.zwb.game.modules.gm;

import com.google.inject.Injector;
import com.zwb.game.core.utils.GameTime;
import com.zwb.game.data.Launcher;
import com.zwb.game.data.Main;
import lombok.extern.slf4j.Slf4j;

/**
 * gm处理器
 * Create by zwb on 2020-01-18 15:35
 */
@Slf4j
public class ReqCommandHandler {


    /**
     * 热更新
     */
    public synchronized void jar() {
        long begin = GameTime.currentMillis();
        log.info("开始热更新...");
        Injector injector = Main.createMain().jar();
        Launcher launcher = injector.getInstance(Launcher.class);
        launcher.jar();
        long end = GameTime.currentMillis();
        log.info("热更新完成，耗时{}ms", end - begin);
    }
}
